﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Dao;
using System.Data;

namespace Website.uc
{
    public partial class ucProductDetail : System.Web.UI.UserControl
    {
        ItemsDao itemDao = new ItemsDao();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadItemInfo();
            }
        }

        public void LoadItemInfo()
        {
            if (Session["id"] != null)
            {
                DataTable tb = itemDao.getItemById(Session["id"].ToString());
                if (tb.Rows.Count > 0)
                {
                    lblDes.Text = tb.Rows[0]["ItemDescription"].ToString();
                    lblIncre.Text = tb.Rows[0]["BidIncremenent"].ToString();
                    lblMini.Text = tb.Rows[0]["Minimumbid"].ToString();
                    lblStatus.Text = tb.Rows[0]["BidEndDate"].ToString();
                    lblTitle.Text = tb.Rows[0]["ItemTitle"].ToString();
                    lblCate.Text = tb.Rows[0]["BidStatus"].ToString();
                    Image1.ImageUrl = tb.Rows[0]["ItemImage"].ToString();
                }

            }
        }
    }
}